package cloud.nacos.config.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @auther xfanonymous
 * @create 2024-01-01 16:58
 *
 * 1. @RefreshScope 使当前类支持在Nacos配置的动态刷新
 * 2. @Value("${}") 从Nacos的配置中获取配置信息
 */
@RestController
@RefreshScope
public class NacosConfigClientController
{
    @Value("${config.info}")
    private String configInfo;

    @GetMapping("/config/info")
    public String getConfigInfo() {
        return configInfo;
    }
}
